#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <unistd.h>

int main(int argc,char*argv[])
{
    pid_t pid;
    pid=fork();
    if(pid < 0)
    {
        printf("error");
        return 1;
    }
    if(pid > 0)
    {
        wait(NULL);
        printf("In parent process,pid = %d\n",getpid());
    }
    else
    {
        execl("./a.out","./a.out","abc","def",(char *)0);
    }
    return 0;
}